package net.jielan188.hd.controller.message;

import com.taobao.api.DefaultTaobaoClient;
import com.taobao.api.TaobaoClient;
import com.taobao.api.request.AlibabaAliqinFcSmsNumSendRequest;
import com.taobao.api.response.AlibabaAliqinFcSmsNumSendResponse;

/**
 * Created by Administrator on 2017-02-14.
 */
public class SendMessage {


    private static final String url = "http://gw.api.taobao.com/router/rest";
    private static final String appkey = "23577326";
    private static final String secret = "a9c790b589ef7c9d94390380f9cf1cb4";

    public static void main( String[] argus ){

        try {
            TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
            AlibabaAliqinFcSmsNumSendRequest req = new AlibabaAliqinFcSmsNumSendRequest();
//            req.setExtend("123456");
            req.setSmsType("normal");
            req.setSmsFreeSignName("传智立行技术支持");
            req.setSmsParamString("{\"name\":\"袁铖\",\"number\":\"123456\"}");
            req.setRecNum("15158038263");
            req.setSmsTemplateCode("SMS_46510033");
            AlibabaAliqinFcSmsNumSendResponse rsp = client.execute(req);
            System.out.println(rsp.getBody());
        }catch ( Exception e ){
            System.out.println( "异常：" + e.getMessage() );
        }
    }
}
